
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/15 9:02
 */

#include "iostream"
#include "algorithm"

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    int nums[n];
    for (int i = 0; i < n; ++i) {
        cin >> nums[i];
    }
    int res = 0;
    int tmp = 0;
    for (int i = 0; i < n; ++i) {
        if (tmp < k) {
            tmp += nums[i];
        } else {
            tmp = nums[i];
            res++;
        }
    }
    if (tmp > 0) res++;
    cout << res;
    return 0;
}